package com.ctshk.rpc.localfun.entity.es;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.ctshk.common.constant.ElasticSearchConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel(value = "LocalFunCacheUp对象", description = "当地玩乐缓存上架对象")
@Document(indexName = ElasticSearchConstant.LOCAL_FUN_INDEX)
public class LocalFunProductCacheUp implements Serializable {

    @ApiModelProperty(value = "產品ID")
    private Long id;

    @ApiModelProperty(value = "产品名称")
    @Field(type = FieldType.Text)
    private String productName;

    @ApiModelProperty(value = "产品编号")
    private String productCode;

    @ApiModelProperty(value = "所属城市id")
    @Field(type = FieldType.Keyword)
    private Long cityId;

    @ApiModelProperty(value = "城市名称")
    @Field(type = FieldType.Keyword)
    private String cityName;

    @ApiModelProperty(value = "游玩类型ID")
    @Field(type = FieldType.Keyword)
    private Long funType;

    @ApiModelProperty(value = "优先级")
    @Field(type = FieldType.Keyword)
    private Integer sort;

    @ApiModelProperty(value = "游玩类型名称")
    @Field(type = FieldType.Keyword)
    private String funName;

    @ApiModelProperty(value = "封面图url")
    @Field(type = FieldType.Keyword, index = false)
    private String coverImage;

    @ApiModelProperty(value = "标题")
    @Field(type = FieldType.Keyword, index = false)
    private String title;

    @ApiModelProperty(value = "H5价格")
    @Field(type = FieldType.Double)
    private Double h5Price;

    @ApiModelProperty(value = "PC价格")
    @Field(type = FieldType.Double)
    private Double pcPrice;

    @ApiModelProperty(value = "PC规格属性")
    @Field(type = FieldType.Nested, index = false)
    private List<LocalFunAttr> pcAttrs;

    @ApiModelProperty(value = "H5规格属性")
    @Field(type = FieldType.Nested, index = false)
    private List<LocalFunAttr> h5Attrs;

    @ApiModelProperty(value = "产品销量")
    @Field(type = FieldType.Integer)
    private Integer saleCount;

    @ApiModelProperty(value = "产品创建时间")
    @Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second)
    private LocalDateTime createDate;

    @ApiModelProperty(value = "产品图片JSON")
    @TableField(typeHandler = FastjsonTypeHandler.class)
    @Field(type = FieldType.Nested, index = false)
    private List<PhotosJson> photosJson;

    @ApiModelProperty(value = "门票Json")
    @TableField(typeHandler = FastjsonTypeHandler.class)
    @Field(type = FieldType.Nested, index = false)
    private List<ThemeJson> themeJson;

    @ApiModelProperty(value = "产品介绍")
    @Field(type = FieldType.Text, index = false)
    private String productIntroduces;

    @ApiModelProperty(value = "是否推荐(0 否 ,1 是)")
    @Field(type = FieldType.Keyword)
    private Integer isRecommend;

    @ApiModelProperty(value = "产品特性Json")
    @TableField(typeHandler = FastjsonTypeHandler.class)
    @Field(type = FieldType.Nested, index = false)
    private List<FutureJson> futureJson;

    @ApiModelProperty(value = "取消政策(1 限时取消  2 不退不改)")
    @Field(type = FieldType.Keyword, index = false)
    private Integer cancelPolicy;

    @ApiModelProperty(value = "预定退改须知")
    @Field(type = FieldType.Keyword, index = false)
    private String customerNotice;

    @ApiModelProperty(value = "使用说明")
    @Field(type = FieldType.Keyword, index = false)
    private String useInstructions;

}
